package com.service.auth.impl;

import java.util.List;

import javax.annotation.Resource;

import com.dao.auth.UserRoleDao;
import com.service.auth.IUserRoleService;

public class UserRoleServiceImpl implements IUserRoleService {
	
	@Resource
	private UserRoleDao userRoleDao;
	

	public List<String> getRolesByUserId(Integer userId) throws Exception {
		
		return userRoleDao.getRolesByUserId(userId);
	}
	
	
	/**
	 * 删除用户所有的角色
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public boolean delUserRolesByUserId(Integer userId) throws Exception{
		
		
		return userRoleDao.delUserRolesByUserId(userId);
	}
	
	
	/**
	 * 插入用户角色
	 * @param userId
	 * @param roleId
	 * @return
	 * @throws Exception
	 */
	public boolean insertUserRoles(Integer userId,Integer roleId) throws Exception{
		
		return userRoleDao.insertUserRoles(userId,roleId);
	}

}
